# Maintainer: Andy Postnikov <apostnikov@gmail.com>
pkgname=php81-pecl-grpc
_extname=grpc
pkgver=1.47.0
pkgrel=0
pkgdesc="PHP 8.1 extension provide a concrete implementation of the gRPC protocol, layered over HTTP/2."
url="https://pecl.php.net/package/grpc"
arch="all !s390x !ppc64le !riscv64" # build failures
license="Apache-2.0"
depends="php81-common"
makedepends="php81-dev openssl-dev linux-headers"
source="php-pecl-$_extname-$pkgver.tgz::https://pecl.php.net/get/$_extname-$pkgver.tgz"
builddir="$srcdir"/$_extname-$pkgver

build() {
	phpize81
	./configure --prefix=/usr --with-php-config=php-config81
	make
}

check() {
	# Test suite is not a part of pecl release.
	php81 -d extension=modules/$_extname.so --ri $_extname
}

package() {
	make INSTALL_ROOT="$pkgdir" install
	local _confdir="$pkgdir"/etc/php81/conf.d
	install -d $_confdir
	echo "extension=$_extname" > $_confdir/50_$_extname.ini
}

sha512sums="
b0e895969656de8e4f1b1098553e1cde5c743ccb282cb3633bbd287d3fc9098febee2d12b096ac62c22cb9ca3e416f4b15e6f38c5d886e49568ae2ec54a4481f  php-pecl-grpc-1.47.0.tgz
"
